<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" >
    <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0,user-scalable=no">
    <title></title>
    <link rel="stylesheet" href="../stylesheets/screen.css"/>
    <link rel="stylesheet" href="../stylesheets/libs/css/font-awesome.min.css"/>
</head>
<body>
<div class="top-bar">
    <div class="container">

        <div class="bar-info">
            <a href="#" class="shopping-cart">
                <i class="fa fa-shopping-cart"></i> 购物车（0）
            </a>
        </div>
        <div class="bar-info">
            <a href="#">登陆</a>
            <span class="sep">|</span>
            <a href="#">注册</a>
        </div>

    </div>
</div>

<div class="header-bar">
    <div class="container">

        <div class="logo">
            <a href="#">R</a>
        </div>

        <div class="nav">
            <ul class="menu">
                <li><a href="">手机</a></li>
                <li><a href="">智能硬件</a></li>
                <li><a href="">平板</a></li>
                <li><a href="">手环</a></li>
                <li><a href="">服务</a></li>
            </ul>
        </div>

        <div class="search">
            <input type="text"/>
            <button><i class="fa fa-search"></i></button>
        </div>

    </div>


</div>


<div class="breadcrumbs">
    <div class="container">
        <a href="/">首页</a>
        <span class="sep">/</span>
        <a href="">服装</a>
        <span class="sep">/</span>
        <a href="">纯红色</a>
    </div>
</div>


<div class="item-detail">
    <div class="main-info">
        <div class="container">
            <div class="pic-box">
                <div class="small">
                    <ul id="small-pic-list">
                        <li class="active ABC ED"><img src="/images/items/item-1-60x60.jpg" data-target="/images/items/item-1-482x482.jpg" alt=""/></li>
                        <li><img src="/images/items/item-2-60x60.jpg" data-target="/images/items/item-2-482x482.jpg"  alt=""/></li>
                    </ul>
                </div>
                <div class="big">
                    <img id="big-pic" src="/images/items/item-1-482x482.jpg" alt=""/>
                </div>
            </div>
            <div class="specifications-box">
                <div class="header">
                    <div class="title">纯色开衫卫衣 男款</div>
                    <div class="desc">简洁经典款型 山寨品牌 做工精良 品质保证</div>
                </div>
                <div class="body">
                    <div class="price">
                        99<sub>元</sub>
                    </div>
                    <div class="specifications">
                        <span class="name">尺码：</span>

                        <ul>
                            <li class="selected"><a href="">L</a></li>
                            <li><a href="">XM</a></li>
                            <li><a href="">M</a></li>
                            <li><a href="">S</a></li>
                            <li><a href="">XL</a></li>
                            <li><a href="">XXL</a></li>
                        </ul>
                    </div>
                    <div class="add-to-cart">
                        <a href="" class="to-cart"><i class="fa fa-cart-plus"></i> 加入购物车</a>
                        <a href="" class="to-favorate"><i class="fa fa-heart-o"></i> 我喜欢</a>
                    </div>

                    <div class="user-faq">
                        <ul>
                            <li><a href="">
                                <i class="fa fa-comment"></i>评价 1234
                            </a></li>
                            <li><a href="">
                                <i class="fa fa-question"></i>提问 2
                            </a></li>
                            <li><a href="">
                                <i class="fa fa-thumbs-o-up"></i> 满意度 99%
                            </a></li>
                        </ul>
                    </div>
                    <div class="more">
                        <a href=""><i class="fa fa-th"></i>查看更多服装</a>
                    </div>

                </div>
            </div>
        </div>
    </div>

    <div class="sub-nav">
        <div class="container">
            <div class="sub-nav-info disvisiable">
                <dt><img src="/images/items/item-1-60x60.jpg" alt=""/></dt>
                <dd>
                    <span>纯色开衫卫衣 男款</span>
                    <p>99元</p>
                </dd>
            </div>
            <div class="item-desc-menu">
                <ul>
                    <li><a href="#item-desc">详情描述</a></li>
                    <li><a href="#item-parameter">规格参数</a></li>
                    <li><a href="">评价晒单</a></li>
                    <li><a href="">商品提问</a></li>
                </ul>
            </div>
            <div class="sub-nav-button disvisiable">
                <a href=""><i class="fa fa-cart-plus"></i>加入购物车</a>
            </div>
        </div>
    </div>

    <div class="item-desc" id="item-desc">
        <div class="container">
            <p>
                <img src="/images/items/item-desc-01.jpg" alt=""/>
                <img src="/images/items/item-desc-02.jpg" alt=""/>
                <img src="/images/items/item-desc-03.jpg" alt=""/>
                <img src="/images/items/item-desc-04.jpg" alt=""/>
                <img src="/images/items/item-desc-05.jpg" alt=""/>
                <img src="/images/items/item-desc-06.jpg" alt=""/>
                <img src="/images/items/item-desc-07.jpg" alt=""/>
            </p>
        </div>
    </div>

    <div class="item-parameter" id="item-parameter">
        <div class="container">
            <div class="header">
                <div class="line"></div>
                <h2>规格参数</h2>
            </div>
            <div class="body">
                <div class="item-pic">
                    <img src="/images/items/item-1-180x180.jpg" alt=""/>
                </div>
                <div class="item-parameters">
                    <ul>
                        <li>材质成分：毛圈布 86.5%棉 13.5%聚酯纤维</li>
                        <li>尺码：S-XXL</li>
                        <li>适合季节：春、秋、冬</li>
                        <li>版型：宽松</li>
                        <li>工艺：绣花</li>
                        <li>品牌：山寨</li>
                        <li>颜色：红色</li>
                        <li>商品编号：1153300021</li>
                    </ul>
                </div>
            </div>
        </div>
    </div>

    <div class="item-comment">
        <div class="container">
            <div class="header">
                <div class="line"></div>
                <h2>晒单评价</h2>
            </div>
            <div class="body">
                <div class="main-block">
                    <ul>
                        <li class="percent">
                            <i>99.99%</i>
                            <span>购买后满意</span>
                        </li>
                        <li class="first">
                            <dt>
                                <div class="face_img"><img src="/images/face/face_1.jpg" alt=""/></div>
                                <div class="name">平淡无奇</div>
                            </dt>
                            <dd> <i class="fa fa-quote-left"></i> 很好，质量不错，就是现在还没到穿的时候</dd>
                        </li>
                        <li class="second">
                            <dt>
                                <div class="face_img"><img src="/images/face/face_2.jpg" alt=""/></div>
                                <div class="name">超凡入画</div>
                            </dt>
                            <dd>
                                <i class="fa fa-quote-left"></i>
                                真的很好，放心购买，面料超级棒，可惜没有裤子，我还的光屁屁出去了，开玩笑，希望我的建议能有用，不说了，顶你个肺
                            </dd>
                        </li>
                    </ul>
                </div>
            </div>

            <div class="footer">
                <div class="detail-comment">
                    <div class="left">
                        <ul class="comment-box">
                            <li>
                                <div class="user-face">
                                    <img src="/images/face/face_1.jpg" alt=""/>
                                </div>
                                <div class="comment">
                                    <div class="detail">
                                        感觉穿上很好，很是舒服感觉穿上很好，很是舒服感觉穿上很好，很是舒服感觉穿上很好，很是舒服感觉穿上很好，很是舒服感觉穿上很好，很是舒服
                                    </div>
                                </div>
                                <div class="user-emoj">
                                    <i class="fa fa-smile-o"></i> 满意
                                </div>
                            </li>
                            <li>
                                <div class="user-face">
                                    <img src="/images/face/face_2.jpg" alt=""/>
                                </div>
                                <div class="comment">
                                    <div class="detail">
                                        感觉穿上很好，很是舒服感觉穿上很好，很是舒服感觉穿上很好，很是舒服感觉穿上很好，很是舒服感觉穿上很好，很是舒服感觉穿上很好，很是舒服
                                    </div>
                                </div>
                                <div class="user-emoj">
                                    <i class="fa fa-frown-o"></i> 不满意
                                </div>
                            </li>

                            <li>
                                <div class="user-face">
                                    <img src="/images/face/face_1.jpg" alt=""/>
                                </div>
                                <div class="comment">
                                    <div class="detail">
                                        感觉穿上很好，很是舒服感觉穿上很好，很是舒服感觉穿上很好，很是舒服感觉穿上很好，很是舒服感觉穿上很好，很是舒服感觉穿上很好，很是舒服
                                    </div>
                                </div>
                                <div class="user-emoj">
                                    <i class="fa fa-smile-o"></i> 满意
                                </div>
                            </li>
                            <li>
                                <div class="user-face">
                                    <img src="/images/face/face_2.jpg" alt=""/>
                                </div>
                                <div class="comment">
                                    <div class="detail">
                                        感觉穿上很好，很是舒服感觉穿上很好，很是舒服感觉穿上很好，很是舒服感觉穿上很好，很是舒服感觉穿上很好，很是舒服感觉穿上很好，很是舒服
                                    </div>
                                </div>
                                <div class="user-emoj">
                                    <i class="fa fa-frown-o"></i> 不满意
                                </div>
                            </li>

                            <li>
                                <div class="user-face">
                                    <img src="/images/face/face_1.jpg" alt=""/>
                                </div>
                                <div class="comment">
                                    <div class="detail">
                                        感觉穿上很好，很是舒服感觉穿上很好，很是舒服感觉穿上很好，很是舒服感觉穿上很好，很是舒服感觉穿上很好，很是舒服感觉穿上很好，很是舒服
                                    </div>
                                </div>
                                <div class="user-emoj">
                                    <i class="fa fa-smile-o"></i> 满意
                                </div>
                            </li>
                            <li>
                                <div class="user-face">
                                    <img src="/images/face/face_2.jpg" alt=""/>
                                </div>
                                <div class="comment">
                                    <div class="detail">
                                        感觉穿上很好，很是舒服感觉穿上很好，很是舒服感觉穿上很好，很是舒服感觉穿上很好，很是舒服感觉穿上很好，很是舒服感觉穿上很好，很是舒服
                                    </div>
                                </div>
                                <div class="user-emoj">
                                    <i class="fa fa-frown-o"></i> 不满意
                                </div>
                            </li>

                        </ul>
                    </div>
                    <div class="right">1</div>
                </div>
            </div>

        </div>
    </div>

</div>



<div class="footer">
    <div class="container">
        <div class="footer-links">
            <div class="link-group">
                <div class="title">帮助中心</div>
                <a href="">购物指南</a>
                <a href="">支付方式</a>
                <a href="">配送方式</a>
            </div>
            <div class="link-group">
                <div class="title">服务支持</div>
                <a href="">相关政策</a>
                <a href="">自助服务</a>
                <a href="">相关知识</a>
            </div>
            <div class="link-group">
                <div class="title">关注我们</div>
                <a href="">新浪微博</a>
                <a href="">腾讯微信</a>
            </div>
            <div class="service-contact">
                <div class="title">服务电话</div>
                <div class="tel">159855221155</div>
                <span>周一至周日 8:00-18:00 </span>
            </div>
        </div>

    </div>
</div>

<script src="/scripts/jquery-2.1.4.min.js" type="text/javascript"></script>

<script>
    var small_pic_list = document.getElementById('small-pic-list');
    var big_pic = document.getElementById('big-pic');

    for(i=0; i<small_pic_list.childNodes.length;i++){
        if( small_pic_list.childNodes.item(i).nodeType == 1 ){
            small_pic_list.childNodes.item(i).addEventListener('click', function(){
               var img = this.childNodes[0];
                var target = img.getAttribute('data-target');
                big_pic.setAttribute('src', target);
                for(j=0; j<this.parentElement.childNodes.length;j++){
                    var ele  = this.parentElement.childNodes.item(j);
                    if(ele.nodeType==1){
                        ele.className = "";
                    }
                }
                this.className = "active";
            })
        }
    }

    var item_desc_menu_link = $(".item-desc-menu a");

    item_desc_menu_link.click(function(e){
        e.preventDefault();

        var href = $(this).attr('href');
        if(href.trim()==''){
            return;
        }
        var pos = $(href.trim()).offset().top;
        var is_down = pos >  ($(document).height()-$(window).height());
        var is_bottom = $(document).scrollTop()>=$(document).height()-$(window).height()

        if(is_down && is_bottom){
            return;
        }

        $("html,body").animate({scrollTop:pos},800);
        $(this).parent().siblings().removeClass("current");
        $(this).parent().addClass('current');

    })

    var sub_nav = $(".sub-nav");
    var sub_nav_pos = sub_nav.offset().top

    var item_desc = $("#item-desc");
    var item_paramster =  $("#item-parameter");

    var sub_nav_info = $(".sub-nav-info");
    var sub_nav_button = $(".sub-nav-button");

    $(window).scroll(function(){
        var top = $(window).scrollTop()
        var item_desc_top = item_desc.offset().top;
        var item_parameter_top = item_paramster.offset().top;


        if(top >= sub_nav_pos){
            sub_nav.addClass('sub-nav-fixed');
            var pos_left =(parseFloat($(window).width())-parseFloat(sub_nav.width()))/2;
            sub_nav.css({left:pos_left});
            sub_nav_info.removeClass("disvisiable");
            sub_nav_button.removeClass("disvisiable");
        }else{
            sub_nav.removeClass('sub-nav-fixed')
            $(item_desc_menu_link).each(function(){
                $(this).parent().removeClass('current');
                sub_nav_info.addClass("disvisiable");
                sub_nav_button.addClass("disvisiable");
            })
        }

        if(top > item_desc_top && top < item_parameter_top){
            $(item_desc_menu_link).each(function(){
                if( $(this).attr("href")!="#item-desc" ){
                    $(this).parent().removeClass("current");
                }else{
                    $(this).parent().addClass("current")
                }
            })
        }

        if(top > item_parameter_top){
            $(item_desc_menu_link).each(function(){
                if( $(this).attr("href")!="#item-parameter" ){
                    $(this).parent().removeClass("current");
                }else{
                    $(this).parent().addClass("current")
                }
            })
        }

    })


</script>


</body>
</html>